<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.org/ui"
                template="/templates/ui.xhtml">

    <ui:define name="head">
    </ui:define>
    <ui:define name="content">
        <div style="margin:5px">
            <p:tabView id="tabview" dynamic="true" cache="false" style="font-weight:normal;font-style:normal">
                <p:tab title="【供货商基本信息】新增表单">
                    <h:form>
                        <div id="qrytable">
                            <p:messages id="msgs" showDetail="false"/>
                            <p:panel style="margin-top:30px">
                                <h:panelGrid columns="4" cellspacing="5">
                                    <h:outputLabel   value="供货商编码:"/>
                                    <p:inputText required="true" value="#{customerAction.oaCustomer.custCode}"/>
                                    <h:outputLabel   value="供货商名称:"/>
                                    <p:inputText required="true" value="#{customerAction.oaCustomer.custName}"/>
                                    <h:outputLabel required="true" value="联系人:"/>
                                    <p:inputText required="true" value="#{customerAction.oaCustomer.custRelation}"/>
                                    <h:outputLabel value="电话:"/>
                                    <p:inputText required="true" value="#{customerAction.oaCustomer.custTele}"/>
                                    <h:outputLabel value="手机:"/>
                                    <p:inputText required="true" value="#{customerAction.oaCustomer.custMobile}"/>
                                    <h:outputLabel value="公司地址:"/>
                                    <p:inputText required="true" value="#{customerAction.oaCustomer.custAddr}"/>
                                    <h:outputLabel value="Email:"/>
                                    <p:inputText required="true" value="#{customerAction.oaCustomer.custEmail}"/>
                                    <h:outputLabel value="传真:"/>
                                    <p:inputText required="true" value="#{customerAction.oaCustomer.custFax}"/>
                                    <h:outputLabel value="备注:"/>
                                    <p:inputText required="true" value="#{customerAction.oaCustomer.remark}"/>
                                </h:panelGrid>
                                <p:separator  style="margin-top:30px"/>
                                <h:panelGrid>
                                    <p:commandButton style="width:120px;" value="提交"
                                                     action="#{customerAction.insertCustomer}"
                                                     update="pdt,msgs">
                                    </p:commandButton>
                                </h:panelGrid>
                            </p:panel>
                            <p:ajaxStatus style="height:18px;text-align:center">
                                <f:facet name="start">
                                    <h:graphicImage value="/images/ajaxloadingbar.gif"/>
                                </f:facet>
                                <f:facet name="complete">
                                    <h:outputText value=""/>
                                </f:facet>
                            </p:ajaxStatus>

                            <p:dataTable id="pdt" dynamic="true" style="width:100%;"
                                         value="#{customerAction.listCustomer}" var="record"
                                         rowKey="#{record.pkid}"
                                         selection="#{customerAction.selectedOaCustomerRecords}"
                                         paginatorTemplate="{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                         paginator="true" rows="15" paginatorPosition="bottom"
                                         rowsPerPageTemplate="100,50,30,15,5"
                                         emptyMessage="...">

                                <p:column headerText="供货商编码">
                                    <h:outputText value="#{record.custCode}"/>
                                </p:column>

                                <p:column headerText="供货商名称">
                                    <h:outputText value="#{record.custName}"/>
                                </p:column>

                                <p:column headerText="联系人">
                                    <h:outputText value="#{record.custRelation}"/>
                                </p:column>

                                <p:column headerText="电话">
                                    <h:outputText value="#{record.custTele}"/>
                                </p:column>

                                <p:column headerText="手机">
                                    <h:outputText value="#{record.custMobile}"/>
                                </p:column>

                                <p:column headerText="Email">
                                    <h:outputText value="#{record.custEmail}"/>
                                </p:column>
                            </p:dataTable>

                        </div>
                    </h:form>
                </p:tab>
            </p:tabView>
        </div>
    </ui:define>
</ui:composition>